package pl.agh.pp.zephyr.utils.parser;

import java.util.Vector;

public class MCUStatus {
	
	private Vector<Room> rooms;
	
	public MCUStatus() {
		rooms = new Vector<MCUStatus.Room>();
	}
	
	public void addRoom(Room room) {
		rooms.add(room);
	}
	
	public int getConnectionsCount() {
		int connectionsCount = 0;
		for(Room room: rooms) {
			connectionsCount += room.getClients().size();
		}
		return connectionsCount;
	}
	
	public Vector<Room> getRooms() {
		return rooms;
	}

	public class Room {
		private String roomName;
		private Vector<Client> clients;

		public Room(String roomName) {
			this.roomName = roomName;
			clients = new Vector<MCUStatus.Client>();
		}

		public void addClient(Client client) {
			clients.add(client);
		}

		public String getRoomName() {
			return roomName;
		}

		public Vector<Client> getClients() {
			return clients;
		}
	}

	public class Client {
		private String clientName;
		private String duration;
		private String codec;
		private String rtpPacketsBytestx;
		private String rtpPacketsBytesrx;
		
		public Client(String clientName, String duration, String codec,
				String rtpPacketsBytestx, String rtpPacketsBytesrx) {
			super();
			this.clientName = clientName;
			this.duration = duration;
			this.codec = codec;
			this.rtpPacketsBytestx = rtpPacketsBytestx;
			this.rtpPacketsBytesrx = rtpPacketsBytesrx;
		}
		
		public String getClientName() {
			return clientName;
		}

		public String getDuration() {
			return duration;
		}

		public String getCodec() {
			return codec;
		}

		public String getRtpPacketsBytestx() {
			return rtpPacketsBytestx;
		}

		public String getRtpPacketsBytesrx() {
			return rtpPacketsBytesrx;
		}
	}
}
